package pl.com.britenet.myredmine.dao.mdb.logic.hbn;

import java.util.List;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
import org.springframework.stereotype.Repository;

import pl.com.britenet.myredmine.dao.mdb.domain.Users;
import pl.com.britenet.myredmine.dao.mdb.logic.UsersDAO;
import pl.com.britenet.myredmine.dao.share.logic.BaseHbnDAO;

@Repository("usersDAO")
public class UsersHbnDAO extends BaseHbnDAO implements UsersDAO {

	@SuppressWarnings("unchecked")
	public List<Users> listUsers() {
		//TODO: dao-mdb/src/main/resources/TAM_PLIKI
//		SessionFactory sessionFactory = new Configuration().configure().buildSessionFactory();
//		Session session = sessionFactory.openSession();
		
		List<Users> users = getHibernateTemplate().find("from Users");
		//session.createQuery("from Users").list();
//		System.out.println("Found " + users.size() + " users.");
				
//		session.close();
		
		return users;
	}

}
